Skip to content

feat: add AF_VSOCK listener - #50

Closed
cablehead wants to merge 1 commit into
mainfrom
feat/vsock-listener
Closed

feat: add AF_VSOCK listener#50
cablehead wants to merge 1 commit into
mainfrom
feat/vsock-listener

Conversation

@cablehead

Copy link
Copy Markdown
Owner

Adds a third transport alongside TCP and Unix domain sockets, so a Cloud Hypervisor / libkrun guest can expose http-nu over AF_VSOCK and the host can bridge it to a unix socket.

Usage

  • http-nu vsock://80 serve.nu (also accepts vsock://<cid>:<port>; always binds VMADDR_CID_ANY)

Details

  • Linux-only, behind the vsock cargo feature (in default); tokio-vsock is target-gated so macOS/Windows still build with the feature inert.
  • accept returns no peer address, like the UDS path: remote_ip/remote_port stay absent and --trust-proxy keeps resolving X-Forwarded-For without panicking.
  • Startup banner prints vsock://:<port>.
  • remote_vsock: {cid, port} metadata deferred for now.

Verification

  • Builds with and without the vsock feature (code fully gated).
  • test_bind_vsock round-trips over the host-local CID (1), no hypervisor needed.
  • cargo clippy --all-features -D warnings clean.

@cablehead
cablehead force-pushed the feat/vsock-listener branch from ca17fd6 to b28a5e8 Compare August 7, 2026 15:03
@cablehead

Copy link
Copy Markdown
Owner Author

I no longer have a personal need for this. If you do, swing by https://discord.com/invite/YNbScHBHrh and have a chat! It should be easy to add.

@cablehead cablehead closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant